ListNode* deleteMiddle(ListNode* head) {
        if(!head->next) return nullptr;
    
        ListNode *fast = head, *slow = head, *pre = nullptr;
        while(fast && fast->next)
        {
            fast = fast->next->next;
            pre = slow;
            slow = slow->next;
        }
        pre->next = pre->next->next;
        return head;
    }